<template>
  <div class="profile">
    <van-sticky>
      <nav-bar right-width="90px" class="nav-bar">
        <div slot="right">
          <i class="iconfont icon-shezhi"></i>
          <i class="iconfont icon-msg"></i>
        </div>
      </nav-bar>
    </van-sticky>
    <div class="profile-body">
      <div class="warp">
        <div class="userInfo">
          <van-image width="50" height="50" round :src="userInfo.avatar" />
          <div style="padding-left: 15px">
            <span class="nickName">{{ userInfo.nickName }}</span>
            <div class="phone">
              {{ userInfo.phone }}
            </div>
          </div>
        </div>
        <div class="other">
          <div class="other-item">
            <span>23</span>
            <div>我的关注</div>
          </div>
          <div class="other-item">
            <span>66</span>
            <div>我的收藏</div>
          </div>
          <div class="other-item">
            <span>8</span>
            <div>浏览记录</div>
          </div>
          <div class="other-item">
            <span>0</span>
            <div>红包卡券</div>
          </div>
        </div>
      </div>
      <div style="margin: -45px 15px 0 15px">
        <div class="panel">
          <div class="panel-heading">
            <span style="font-weight：600">我的订单</span>
            <span style="color: #a1a4aa" @click="$router.push('/order')"
              >查看全部
              <i class="iconfont icon-xiayiye"></i>
            </span>
          </div>
          <div class="panel-body">
            <div class="panel-body-item">
              <i class="iconfont icon-qianbao"></i>
              <div>待付款</div>
            </div>
            <div class="panel-body-item">
              <i class="iconfont icon-daifahuo"></i>
              <div>待发货</div>
            </div>
            <div class="panel-body-item">
              <i class="iconfont icon-daishouhuo"></i>
              <div>待收货</div>
            </div>
            <div class="panel-body-item">
              <i class="iconfont icon-pingjia"></i>
              <div>待评价</div>
            </div>
            <div class="panel-body-item">
              <i class="iconfont icon-tuihuanhuo"></i>
              <div>退换货</div>
            </div>
          </div>
        </div>
        <div class="service"></div>
      </div>
    </div>
  </div>
</template>

<script>
import NavBar from '../../components/nav-bar/nav-bar'
import { mapState } from 'vuex'
export default {
  components: { NavBar },
  computed: { ...mapState(['userInfo']) }
}
</script>

<style lang="less" scoped>
.profile {
  background-color: #f7f7f7;
  // min-height: 100vh;
  padding-bottom: 52px;
}
.nav-bar {
  background: var(--theme-color);
  div {
    display: flex;
    justify-content: space-evenly;
    iconfont {
      color: white;
    }
  }
}
.warp {
  background: linear-gradient(
    to bottom,
    var(--theme-color),
    var(--theme-color),
    white
  );
  color: white;
  font-size: 12px;
  padding: 5px 15px;
  height: 150px;
}
.userInfo {
  display: flex;
  align-items: center;
  .nickName {
    line-height: 25px;
    font-weight: 600;
  }
}
.other {
  display: flex;
  height: 50px;
  align-items: center;
  .other-item {
    flex: 1;
    text-align: center;
  }
  span {
    font-weight: 600;
    font-size: 14px;
  }
}
.panel {
  /*   height: 100px; */
  background-color: white;
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 5px 15px;
  .panel-heading {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
  }
  .panel-body {
    display: flex;
    .panel-body-item {
      flex: 1;
      text-align: center;
      font-size: 12px;
      .iconfont {
        font-size: 18px;
        color: var(--theme-color);
      }
    }
  }
}
.service {
  background: url('../../assets/img/service.png') no-repeat;
  background-size: 100% 100%;
  height: calc(100vh - 250px - 44px);
  border-radius: 8px;
}
</style>
